<template>
<div style="margin-top:18px">
  <el-card class="box-card" shadow="never">
    <div slot="header">
      <span class="has-text-weight-bold">{{$t('common.blog')}}</span>
    </div>
    <div style="text-align:center">
       <el-button type="danger" outlined @click="clickEvent"><i class="el-icon-edit" >{{$t('common.postblogs')}}</i></el-button>
    </div>
  </el-card>
</div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'LoginWelcome',
  data() {
    return {}
  },
  methods:{
    clickEvent(){
      if(this.token!=null&&this.token!=''){
        this.$router.push('/post/create')
      }
      else{
        alert("未登录，请先登录")
        this.$router.push( '/login' )
      }
    }
  },
    computed: {
    ...mapGetters([
      'token'
    ])
  }

}
</script>

<style scoped>
</style>